<template>
  <view class="create-center">
    <!-- 顶部自定义导航 -->
    <tn-nav-bar fixed backgroundColor="#1c1d21" customBack><text class="tn-text-lg tn-color-white"
        style="margin-right: 30rpx;">创作中心</text></tn-nav-bar>

    <view :style="{ paddingTop: vuex_custom_bar_height + 'px' }"></view>

    <view class="create-content" @click="tn('/activityPages/topic')">
      <view class="create-content-left">
        <view class="create-content-left-title">
          <text class="create-content-left-title-text">创建智能体</text>
          <text class="tn-icon-right" style="font-size: 30rpx;font-weight: bold;padding-left: 10rpx;"></text>
        </view>
        <view style="font-size: 24rpx;">本周剩余</view>
      </view>
      <view class="create-content-right">
        <text class="tn-icon-folder-add-fill" style="font-size: 90rpx;"></text>
      </view>
    </view>

    <view class="flex-content">
      <view class="flex-left" @click="tn('/circlePages/king')">
        <view class="flex-left-title">
          <text class="tn-icon-folder-fill" style="font-size: 40rpx;"></text>
          <text style="font-size: 30rpx;padding-left:10rpx;">我的智能体</text>
        </view>
        <view class="draft">
          <view class="tn-draft">查看我的智能体</view>
          <text class="tn-icon-right" style="font-size: 20rpx;"></text>
        </view>
      </view>
      <view class="flex-left" @click="tn('/circlePages/details')">
        <view class="flex-left-title">
          <text class="tn-icon-menu-circle-fill" style="font-size: 40rpx;"></text>
          <text style="font-size: 30rpx;padding-left:10rpx;">更多智能体</text>
        </view>
        <view class="draft">
          <view class="tn-draft">体验更多智能体</view>
          <text class="tn-icon-right" style="font-size: 20rpx;"></text>
        </view>
      </view>
    </view>

    <view class="create-content-flex">
      <view class="create-content-flex-left">素材创作</view>
      <view class="create-content-flex-right">
        <view style="padding-right: 10rpx;">全部</view>
        <text class="tn-icon-right" style="font-size: 20rpx;"></text>
      </view>
    </view>

    <!-- <view class="material-content" @click="tn('/activityPages/project')">
      <text class="tn-icon-add tn-color-yellow" style="font-size: 60rpx;font-weight: bold;"></text>
      <view style="color: #fff;font-size: 28rpx;margin-top: 28rpx;">创建形象</view>
    </view> -->
   <!-- <view class="material-content" @click="tn('/activityPages/planet')">
      <text class="tn-icon-add tn-color-yellow" style="font-size: 60rpx;font-weight: bold;"></text>
      <view style="color: #fff;font-size: 28rpx;margin-top: 28rpx;">创建音色</view>
    </view> -->


    <!-- 流星-->
    <!-- <view class="tn-satr">
      <view class="sky"></view>
      <view class="stars">
        <view class="falling-stars">
          <view class="star-fall"></view>
          <view class="star-fall"></view>
          <view class="star-fall"></view>
          <view class="star-fall"></view>
        </view>
        <view class="small-stars">
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
        </view>
        <view class="medium-stars">
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
          <view class="star"></view>
        </view>
      </view>
    </view> -->



    <!-- <swiper class="card-swiper" :current="cardCur" :circular="true" :autoplay="false" duration="500" interval="18000"
      @change="cardSwiper">
      <swiper-item v-for="(item, index) in swiperList" :key="index" :class="cardCur == index ? 'cur' : ''">
        <view class="swiper-item image-banner">
          <image :src="item.url" mode="heightFix" v-if="item.type == 'image'"></image>
        </view>
        <view class="swiper-item-text tn-text-center">
          <view class="tn-text-bold tn-padding-top-xs tn-color-white">
            <text class="tn-icon-copy tn-padding-right-xs"></text>
            {{ item.name }}
            <text class="tn-icon-copy tn-padding-left-xs"></text>
          </view>
        </view>

      </swiper-item>
    </swiper> -->

    <!-- <view class="indication">
      <block v-for="(item, index) in swiperList" :key="index">
        <view class="spot tn-text-center tn-padding-top-sm tn-shadow-blur" :style="'color:' + item.color + ';'"
          :class="cardCur == index ? 'active' : ''" @tap.stop="handleSwiperClick(index)">
          <view class="tn-text-xxl icon-text" :class="'tn-icon-' + item.icon + ';'"></view>
          <view class="tn-text-sm">{{ item.get }}</view>
        </view>
      </block>
    </view> -->


    <!-- 悬浮按钮-->
    <!-- <view class="tn-flex tn-footerfixed">
      <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center" @click="tn('/activityPages/topic')">
        <tn-button shape="round" backgroundColor="#fb3a72" padding="40rpx 0" width="60%" shadow fontBold>
          <text class="tn-color-white">去创建智能体</text>
        </tn-button>
      </view>
    </view> -->

    <view class='tn-tabbar-height'></view>

  </view>
</template>

<script>
import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
export default {
  name: 'TemplatePlanet',
  mixins: [template_page_mixin],
  data() {
    return {
      cardCur: 0,
      swiperList: [{
        id: 0,
        type: 'image',
        name: '设置智能体昵称与简介',
        get: '第一步',
        icon: 'cube',
        url: '/static/planet.png',
      }, {
        id: 1,
        type: 'image',
        name: '设置智能体形象',
        get: '第二步',
        icon: 'cube',
        url: '/static/planet.png',
      }, {
        id: 2,
        type: 'image',
        name: '设置智能体音色',
        get: '第三步',
        icon: 'cube',
        url: '/static/planet.png',
      }, {
        id: 3,
        type: 'image',
        name: '设置智能体类型',
        get: '第四步',
        icon: 'cube',
        url: '/static/planet.png',
      }],
      list: [
        { image: 'xxx.jpg', title: 'xxx' },
        { image: 'xxx.jpg', title: 'xxx' },
      ],
      navHeight: '', //整体顶部导航栏的高度
      statusBarHeight: '',//状态栏高度
    }
  },
  created() {
    //获取手机系统的信息（主要是获取状态栏和胶囊的高度）
    let { statusBarHeight, system } = uni.getSystemInfoSync();
    this.statusBarHeight = statusBarHeight;
    this.navHeight = statusBarHeight + (system.indexOf("iOS") > -1 ? 44 : 48);
  },
  methods: {
    // cardSwiper
    cardSwiper(e) {
      this.cardCur = e.detail.current
    },
    // swiper点击事件
    handleSwiperClick(index) {
      this.cardCur = index
    },
    // 跳转
    tn(e) {
      uni.navigateTo({
        url: e,
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.create-center {
  margin: 0 30rpx;

  .status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1c1d21;
  }

  .create-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 230rpx;
    border-radius: 30rpx;
    background: linear-gradient(120deg, #2B3363 0%, #5E6AB5 100%);
    margin: 20rpx auto 0;
    padding: 0 38rpx;

    .create-content-left-title {
      display: flex;
      align-items: center;

      .create-content-left-title-text {
        font-size: 40rpx;
        font-weight: bold;
      }
    }
  }

  .flex-content {
    // width: 92%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;

    .flex-left {
      display: flex;
      flex-direction: column;
      width: 48%;
      height: 150rpx;
      background-color: #2d2d2f;
      border-radius: 30rpx;
      margin: 20rpx 0rpx;
      padding: 35rpx 30rpx;

      .flex-left-title {
        display: flex;
        align-items: center;
        color: #fff;
      }

      .draft {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #727277;
        margin-top: 10rpx;

        .tn-draft {
          font-size: 24rpx;
        }
      }

    }
  }

  .create-content-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40rpx;

    .create-content-flex-left {
      color: #fff;
      font-size: 33rpx;
    }

    .create-content-flex-right {
      display: flex;
      align-items: center;
      color: #727277;

    }
  }

  .material-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 250rpx;
    height: 250rpx;
    border-radius: 30rpx;
    background-color: #2d2d2f;
    margin-top: 40rpx;
    box-sizing: border-box;

    .tn-color-yellow {
      color: #fbe5ad !important;
    }

  }
}


.template-planet {
  margin: 0;
  width: 100%;
  height: 100vh;
  color: #fff;
  overflow: hidden;
  animation: color-loop 18s infinite;
}

@keyframes color-loop {
  0% {
    background: #1c1d21;
  }

  25% {
    background: #1c1d21;
  }

  50% {
    background: #1c1d21;
  }

  75% {
    background: #1c1d21;
  }

  100% {
    background: #1c1d21;
  }
}

/* 胶囊*/
.tn-custom-nav-bar__back {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  box-sizing: border-box;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 1000rpx;
  border: 1rpx solid rgba(255, 255, 255, 0.5);
  color: #FFFFFF;
  font-size: 18px;

  .icon {
    display: block;
    flex: 1;
    margin: auto;
    text-align: center;
  }

  &:before {
    content: " ";
    width: 1rpx;
    height: 110%;
    position: absolute;
    top: 22.5%;
    left: 0;
    right: 0;
    margin: auto;
    transform: scale(0.5);
    transform-origin: 0 0;
    pointer-events: none;
    box-sizing: border-box;
    opacity: 0.7;
    background-color: #FFFFFF;
  }
}


/* 视觉差轮播*/
.card-swiper {
  height: 80vh !important;
}

.card-swiper swiper-item {
  width: 750rpx !important;
  left: 0rpx;
  box-sizing: border-box;
  overflow: initial;
}

.card-swiper swiper-item .swiper-item {
  margin-top: 15vh;
  width: 750rpx;
  height: 750rpx;
  border-radius: 0rpx;
  transform: translate(0rpx, 0rpx) scale(0.8);
  transition: all 0.2s ease-in 0s;
  will-change: transform;
  overflow: hidden;
  opacity: 1;
}

.card-swiper swiper-item.cur .swiper-item {
  transform: translate(0rpx, 0rpx) scale(1, 1);
  transition: all 0.2s ease-in 0s;
  will-change: transform;
  opacity: 1;
}

.card-swiper swiper-item .swiper-item-text {
  margin-top: -5vh;
  width: 100%;
  // height: 100%;
  display: block;
  border-radius: 10rpx;
  transform: scale(0.7, 0.7);
  transition: all 0.4s ease 0s;
  will-change: transform;
  overflow: hidden;
  opacity: 0;
}

.card-swiper swiper-item.cur .swiper-item-text {
  padding-left: 30rpx;
  transform: scale(1);
  transition: all 0.4s ease 0s;
  will-change: transform;
  opacity: 1;
}

.image-banner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-banner image {
  width: 100%;
}

/* 轮播指示点 start*/
.indication {
  z-index: 9999;
  width: 100%;
  height: 36rpx;
  position: absolute;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.spot {
  opacity: 1;
  width: 100rpx;
  height: 80rpx;
  border-radius: 20rpx;
  margin: 20rpx 15rpx !important;
  left: 0rpx;
  right: 0;
  top: -65vh;
  position: relative;
}

.spot.active .icon-text {
  transform: scale(1.6);
  margin-bottom: 20rpx;
  opacity: 1;
}

/* 底部悬浮按钮 start*/
.tn-tabbar-height {
  min-height: 100rpx;
  height: calc(120rpx + env(safe-area-inset-bottom) / 2);
}

.tn-footerfixed {
  position: fixed;
  width: 100%;
  bottom: calc(168rpx + env(safe-area-inset-bottom));
  z-index: 1024;
  box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);

}

/* 底部悬浮按钮 end*/

/* 流星*/
.tn-satr {
  position: fixed;
  width: 100%;
  height: 600px;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 998;
}

.stars {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 400px;
}

.star {
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
}

.small-stars .star {
  position: absolute;
  width: 3px;
  height: 3px;
}

.small-stars .star:nth-child(2n) {
  opacity: 0;
  -webkit-animation: star-blink 1.2s linear infinite alternate;
  animation: star-blink 1.2s linear infinite alternate;
}

.small-stars .star:nth-child(1) {
  left: 40px;
  bottom: 50px;
}

.small-stars .star:nth-child(2) {
  left: 200px;
  bottom: 40px;
}

.small-stars .star:nth-child(3) {
  left: 60px;
  bottom: 120px;
}

.small-stars .star:nth-child(4) {
  left: 140px;
  bottom: 250px;
}

.small-stars .star:nth-child(5) {
  left: 400px;
  bottom: 300px;
}

.small-stars .star:nth-child(6) {
  left: 170px;
  bottom: 80px;
}

.small-stars .star:nth-child(7) {
  left: 200px;
  bottom: 360px;
  -webkit-animation-delay: .2s;
  animation-delay: .2s;
}

.small-stars .star:nth-child(8) {
  left: 250px;
  bottom: 320px;
}

.small-stars .star:nth-child(9) {
  left: 300px;
  bottom: 340px;
}

.small-stars .star:nth-child(10) {
  left: 130px;
  bottom: 320px;
  -webkit-animation-delay: .5s;
  animation-delay: .5s;
}

.small-stars .star:nth-child(11) {
  left: 230px;
  bottom: 330px;
  -webkit-animation-delay: 7s;
  animation-delay: 7s;
}

.small-stars .star:nth-child(12) {
  left: 300px;
  bottom: 360px;
  -webkit-animation-delay: .3s;
  animation-delay: .3s;
}

@-webkit-keyframes star-blink {
  50% {
    width: 3px;
    height: 3px;
    opacity: 1;
  }
}

@keyframes star-blink {
  50% {
    width: 3px;
    height: 3px;
    opacity: 1;
  }
}

.medium-stars .star {
  position: absolute;
  width: 3px;
  height: 3px;
  opacity: 0;
  -webkit-animation: star-blink 1.2s ease-in infinite alternate;
  animation: star-blink 1.2s ease-in infinite alternate;
}

.medium-stars .star:nth-child(1) {
  left: 300px;
  bottom: 50px;
}

.medium-stars .star:nth-child(2) {
  left: 400px;
  bottom: 40px;
  -webkit-animation-delay: .4s;
  animation-delay: .4s;
}

.medium-stars .star:nth-child(3) {
  left: 330px;
  bottom: 300px;
  -webkit-animation-delay: .2s;
  animation-delay: .2s;
}

.medium-stars .star:nth-child(4) {
  left: 460px;
  bottom: 300px;
  -webkit-animation-delay: .9s;
  animation-delay: .9s;
}

.medium-stars .star:nth-child(5) {
  left: 300px;
  bottom: 150px;
  -webkit-animation-delay: 1.2s;
  animation-delay: 1.2s;
}

.medium-stars .star:nth-child(6) {
  left: 440px;
  bottom: 120px;
  -webkit-animation-delay: 1s;
  animation-delay: 1s;
}

.medium-stars .star:nth-child(7) {
  left: 200px;
  bottom: 140px;
  -webkit-animation-delay: .8s;
  animation-delay: .8s;
}

.medium-stars .star:nth-child(8) {
  left: 30px;
  bottom: 480px;
  -webkit-animation-delay: .3s;
  animation-delay: .3s;
}

.medium-stars .star:nth-child(9) {
  left: 460px;
  bottom: 400px;
  -webkit-animation-delay: 1.2s;
  animation-delay: 1.2s;
}

.medium-stars .star:nth-child(10) {
  left: 150px;
  bottom: 10px;
  -webkit-animation-delay: 1s;
  animation-delay: 1s;
}

.medium-stars .star:nth-child(11) {
  left: 420px;
  bottom: 450px;
  -webkit-animation-delay: 1.2s;
  animation-delay: 1.2s;
}

.medium-stars .star:nth-child(12) {
  left: 340px;
  bottom: 180px;
  -webkit-animation-delay: 1.1s;
  animation-delay: 1.1s;
}

@keyframes star-blink {
  50% {
    width: 4px;
    height: 4px;
    opacity: 1;
  }
}

.star-fall {
  position: relative;
  border-radius: 2px;
  width: 80px;
  height: 2px;
  overflow: hidden;
  -webkit-transform: rotate(-20deg);
  transform: rotate(-20deg);
}

.star-fall:after {
  content: "";
  position: absolute;
  width: 50px;
  height: 2px;
  background: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0)), to(rgba(255, 255, 255, 0.4)));
  background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.4) 100%);
  left: 100%;
  -webkit-animation: star-fall 3.6s linear infinite;
  animation: star-fall 3.6s linear infinite;
}

.star-fall:nth-child(1) {
  left: 80px;
  bottom: -100px;
}

.star-fall:nth-child(1):after {
  -webkit-animation-delay: 2.4s;
  animation-delay: 2.4s;
}

.star-fall:nth-child(2) {
  left: 200px;
  bottom: -200px;
}

.star-fall:nth-child(2):after {
  -webkit-animation-delay: 2s;
  animation-delay: 2s;
}

.star-fall:nth-child(3) {
  left: 430px;
  bottom: -50px;
}

.star-fall:nth-child(3):after {
  -webkit-animation-delay: 3.6s;
  animation-delay: 3.6s;
}

.star-fall:nth-child(4) {
  left: 400px;
  bottom: 100px;
}

.star-fall:nth-child(4):after {
  -webkit-animation-delay: .2s;
  animation-delay: .2s;
}

@-webkit-keyframes star-fall {
  20% {
    left: -100%;
  }

  100% {
    left: -100%;
  }
}

@keyframes star-fall {
  20% {
    left: -100%;
  }

  100% {
    left: -100%;
  }
}
</style>
